+Mon Feb 22 19:06:30 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+ windows with a proxy, set the window field in the
+ sent event to the original window, not to the proxy.
+ (This gives consistency with Motif, and also provides
+ information to the destination that it wouldn't have
+ otherwise).
+
+ * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+ * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+ Xdnd event to the root window, set the event mask
+ to ButtonPressMask. Hopefully, this should give us
+ compatibility with kfm, if it uses the Qt style
+ of root window drops.
+
Mon Feb 22 08:45:10 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml:
+Mon Feb 22 19:06:30 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+ windows with a proxy, set the window field in the
+ sent event to the original window, not to the proxy.
+ (This gives consistency with Motif, and also provides
+ information to the destination that it wouldn't have
+ otherwise).
+
+ * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+ * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+ Xdnd event to the root window, set the event mask
+ to ButtonPressMask. Hopefully, this should give us
+ compatibility with kfm, if it uses the Qt style
+ of root window drops.
+
Mon Feb 22 08:45:10 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml:
+Mon Feb 22 19:06:30 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+ windows with a proxy, set the window field in the
+ sent event to the original window, not to the proxy.
+ (This gives consistency with Motif, and also provides
+ information to the destination that it wouldn't have
+ otherwise).
+
+ * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+ * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+ Xdnd event to the root window, set the event mask
+ to ButtonPressMask. Hopefully, this should give us
+ compatibility with kfm, if it uses the Qt style
+ of root window drops.
+
Mon Feb 22 08:45:10 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml:
+Mon Feb 22 19:06:30 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+ windows with a proxy, set the window field in the
+ sent event to the original window, not to the proxy.
+ (This gives consistency with Motif, and also provides
+ information to the destination that it wouldn't have
+ otherwise).
+
+ * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+ * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+ Xdnd event to the root window, set the event mask
+ to ButtonPressMask. Hopefully, this should give us
+ compatibility with kfm, if it uses the Qt style
+ of root window drops.
+
Mon Feb 22 08:45:10 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml:
+Mon Feb 22 19:06:30 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+ windows with a proxy, set the window field in the
+ sent event to the original window, not to the proxy.
+ (This gives consistency with Motif, and also provides
+ information to the destination that it wouldn't have
+ otherwise).
+
+ * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+ * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+ Xdnd event to the root window, set the event mask
+ to ButtonPressMask. Hopefully, this should give us
+ compatibility with kfm, if it uses the Qt style
+ of root window drops.
+
Mon Feb 22 08:45:10 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml:
+Mon Feb 22 19:06:30 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+ windows with a proxy, set the window field in the
+ sent event to the original window, not to the proxy.
+ (This gives consistency with Motif, and also provides
+ information to the destination that it wouldn't have
+ otherwise).
+
+ * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+ * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+ Xdnd event to the root window, set the event mask
+ to ButtonPressMask. Hopefully, this should give us
+ compatibility with kfm, if it uses the Qt style
+ of root window drops.
+
Mon Feb 22 08:45:10 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml:
+Mon Feb 22 19:06:30 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdnd.c (xdnd_send_*): When sending events to
+ windows with a proxy, set the window field in the
+ sent event to the original window, not to the proxy.
+ (This gives consistency with Motif, and also provides
+ information to the destination that it wouldn't have
+ otherwise).
+
+ * gtk/gtkdnd.c: Fixed some refcount leaks for windows.
+
+ * gdk/gdkdnd.c (xdnd_send_xevent): When sending
+ Xdnd event to the root window, set the event mask
+ to ButtonPressMask. Hopefully, this should give us
+ compatibility with kfm, if it uses the Qt style
+ of root window drops.
+
Mon Feb 22 08:45:10 GMT 1999 Tony Gale <gale@gtk.org>
* docs/gtk_tut.sgml:
#include "gdk/gdkprivate.h"
#include "gdk.h"
+#define NEW_DRAGS
+
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
typedef enum {
{
GList *tmp_list = contexts;
GdkDragContext *context;
+ GdkDragContextPrivate *private;
+ Window context_dest_xid;
while (tmp_list)
{
context = (GdkDragContext *)tmp_list->data;
+ private = (GdkDragContextPrivate *)context;
+
+ context_dest_xid = context->dest_window ?
+ (private->dest_xid ?
+ private->dest_xid :
+ GDK_WINDOW_XWINDOW (context->dest_window)) :
+ None;
if ((!context->is_source == !is_source) &&
((source_xid == None) || (context->source_window &&
(GDK_WINDOW_XWINDOW (context->source_window) == source_xid))) &&
- ((dest_xid == None) || (context->dest_window &&
- (GDK_WINDOW_XWINDOW (context->dest_window) == dest_xid))))
+ ((dest_xid == None) || (context_dest_xid == dest_xid)))
return context;
tmp_list = tmp_list->next;
private->xdnd_actions = context->actions;
}
+/*************************************************************
+ * xdnd_send_xevent:
+ * Like gdk_send_event, but if the target is the root
+ * window, sets an event mask of ButtonPressMask, otherwise
+ * an event mask of 0.
+ * arguments:
+ *
+ * results:
+ *************************************************************/
+
+gint
+xdnd_send_xevent (Window window, gboolean propagate,
+ XEvent *event_send)
+{
+ if (window == gdk_root_window)
+ return gdk_send_xevent (window, propagate, ButtonPressMask, event_send);
+ else
+ return gdk_send_xevent (window, propagate, 0, event_send);
+}
+
static void
xdnd_send_enter (GdkDragContext *context)
{
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+ xev.xclient.window = private->dest_xid ?
+ private->dest_xid :
+ GDK_WINDOW_XWINDOW (context->dest_window);
+#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = (3 << 24); /* version */
xev.xclient.data.l[2] = 0;
}
}
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+ FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
{
XEvent xev;
+ GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+ xev.xclient.window = private->dest_xid ?
+ private->dest_xid :
+ GDK_WINDOW_XWINDOW (context->dest_window);
+#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+ FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
static void
xdnd_send_drop (GdkDragContext *context, guint32 time)
{
+ GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
XEvent xev;
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndDrop", FALSE);
xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+ xev.xclient.window = private->dest_xid ?
+ private->dest_xid :
+ GDK_WINDOW_XWINDOW (context->dest_window);
+#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = time;
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+ FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndPosition", FALSE);
xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+ xev.xclient.window = private->dest_xid ?
+ private->dest_xid :
+ GDK_WINDOW_XWINDOW (context->dest_window);
+#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = (x_root << 16) | y_root;
xev.xclient.data.l[3] = time;
xev.xclient.data.l[4] = xdnd_action_to_atom (action);
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+ FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = xdnd_action_to_atom (action);
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
+ FALSE, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XWINDOW (context->source_window)));
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
+ FALSE, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XWINDOW (context->source_window)));
#include "gdk/gdkprivate.h"
#include "gdk.h"
+#define NEW_DRAGS
+
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
typedef enum {
{
GList *tmp_list = contexts;
GdkDragContext *context;
+ GdkDragContextPrivate *private;
+ Window context_dest_xid;
while (tmp_list)
{
context = (GdkDragContext *)tmp_list->data;
+ private = (GdkDragContextPrivate *)context;
+
+ context_dest_xid = context->dest_window ?
+ (private->dest_xid ?
+ private->dest_xid :
+ GDK_WINDOW_XWINDOW (context->dest_window)) :
+ None;
if ((!context->is_source == !is_source) &&
((source_xid == None) || (context->source_window &&
(GDK_WINDOW_XWINDOW (context->source_window) == source_xid))) &&
- ((dest_xid == None) || (context->dest_window &&
- (GDK_WINDOW_XWINDOW (context->dest_window) == dest_xid))))
+ ((dest_xid == None) || (context_dest_xid == dest_xid)))
return context;
tmp_list = tmp_list->next;
private->xdnd_actions = context->actions;
}
+/*************************************************************
+ * xdnd_send_xevent:
+ * Like gdk_send_event, but if the target is the root
+ * window, sets an event mask of ButtonPressMask, otherwise
+ * an event mask of 0.
+ * arguments:
+ *
+ * results:
+ *************************************************************/
+
+gint
+xdnd_send_xevent (Window window, gboolean propagate,
+ XEvent *event_send)
+{
+ if (window == gdk_root_window)
+ return gdk_send_xevent (window, propagate, ButtonPressMask, event_send);
+ else
+ return gdk_send_xevent (window, propagate, 0, event_send);
+}
+
static void
xdnd_send_enter (GdkDragContext *context)
{
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+ xev.xclient.window = private->dest_xid ?
+ private->dest_xid :
+ GDK_WINDOW_XWINDOW (context->dest_window);
+#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = (3 << 24); /* version */
xev.xclient.data.l[2] = 0;
}
}
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+ FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
{
XEvent xev;
+ GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+ xev.xclient.window = private->dest_xid ?
+ private->dest_xid :
+ GDK_WINDOW_XWINDOW (context->dest_window);
+#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+ FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
static void
xdnd_send_drop (GdkDragContext *context, guint32 time)
{
+ GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
XEvent xev;
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndDrop", FALSE);
xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+ xev.xclient.window = private->dest_xid ?
+ private->dest_xid :
+ GDK_WINDOW_XWINDOW (context->dest_window);
+#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = time;
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+ FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndPosition", FALSE);
xev.xclient.format = 32;
+#ifdef NEW_DRAGS
+ xev.xclient.window = private->dest_xid ?
+ private->dest_xid :
+ GDK_WINDOW_XWINDOW (context->dest_window);
+#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
+#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = (x_root << 16) | y_root;
xev.xclient.data.l[3] = time;
xev.xclient.data.l[4] = xdnd_action_to_atom (action);
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
+ FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = xdnd_action_to_atom (action);
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
+ FALSE, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XWINDOW (context->source_window)));
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
- if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
- FALSE, 0, &xev))
+ if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
+ FALSE, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_WINDOW_XWINDOW (context->source_window)));
context->suggested_action,
context->actions, time);
+ if (!site->proxy_window && dest_window)
+ gdk_window_unref (dest_window);
+
selection = gdk_drag_get_selection (info->proxy_source->context);
if (selection &&
selection != gdk_drag_get_selection (info->context))
current_event->dnd.y_root,
&dest_window, &proto);
}
-
+
gdk_drag_motion (info->proxy_source->context,
dest_window, proto,
current_event->dnd.x_root,
context->suggested_action,
context->actions, time);
+ if (!site->proxy_window && dest_window)
+ gdk_window_unref (dest_window);
+
selection = gdk_drag_get_selection (info->proxy_source->context);
if (selection &&
selection != gdk_drag_get_selection (info->context))